package DesignPatern.A08_调停者模式.A001_问题;

/**
 * @Author: Du
 * @Date: 2021/7/23 8:09
 */
public class Purchase
{
    public void buyIBMComputer(int number)
    {
        Stock stock = new Stock();
        Sale sale = new Sale();
        
        int saleStatus = sale.getSaleStatus();
        if (saleStatus > 80)
        {
            System.out.println("采购电脑：" + number + "台");
            stock.increase(number);
        } else
        {
            int buyNumber = number / 2;
            System.out.println("采购电脑：" + buyNumber + "台");
        }
    }
    
    public void refuseIBM()
    {
        System.out.println("不再采购电脑");
    }
}
